<?php
include_once "com/code/Model.php";

class VideoModel extends Model {

	public function __construct() {
		parent::__construct();
	}

	public function __destruct() {
		parent::__destruct();
	}

	public function getVideoBean($id) {
		$connection = mysql_connect("localhost", "root", "3lm4rc3l0");
		mysql_set_charset('utf8', $connection);
		mysql_select_db("visual", $connection);

		$id = mysql_real_escape_string($id, $connection);

		$query =  " SELECT * ";
		$query .= " FROM Video ";
		$query .= " WHERE Video.id = ".$id;

		$result = mysql_query($query, $connection) or die(mysql_error());

		$videoBean = mysql_fetch_object($result);

		mysql_free_result($result);
		mysql_close($connection);
		
		return $videoBean;
	}
}
?>